﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Services.TestTools.UITesting.Html;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;


namespace TestCalculator
{
    public class Calculator : Page
    {
        #region Variables
        private string _firstNumber;
        private string _secondNumber;
        private string _result;

        #endregion

        #region Properties
        public string FirstNumber
        {
            get { return _firstNumber; }
            set { _firstNumber = value; }
        }
        public string SecondNumber
        {
            get { return _secondNumber; }
            set { _secondNumber = value; }
        }
        public string Result
        {
            get { return _result; }
            set { _result = value; }
        }

        
        #endregion

        public void Multiply()
        {

            Window.Find<WinButton>(new { Name = FirstNumber }).Click();
            Window.Find<WinButton>(new { Name = "Multiply" }).Click();
            Window.Find<WinButton>(new { Name = SecondNumber }).Click();
            Window.Find<WinButton>(new { Name = "Equals" }).Click();

        }

        public void VerifyResult()
        {
            Assert.IsTrue(Window.Find<WinText>(new { Name = "Result" }).DisplayText == Result);
        }

    }
}
